#pragma once

enum LITTLE_WORLD_OBJECT_TYPE
{
	LWOT_PLAYER_MANAGER=0x61,
	LWOT_MAP_AREA=0x62,
	LWOT_PLAYER=0x63,
	LWOT_NPC_MANAGER=0x64,
	LWOT_NPC=0x65,
	LWOT_CHAR_QUERY_CENTER=0x66,
	LWOT_PLATER_CHAR_DATA_DB_ADAPTER=0x67
};

enum LITTLE_WORLD_ID_TYPE
{
	LWIT_ACCOUNT_ID=1,
	LWIT_CHAR_ID=2,	
};


enum SST_MOVE_STATUS
{
	SST_MS_XPOS							=1,
	SST_MS_YPOS							=2,
	SST_MS_HEIGHT						=3,
	SST_MS_DIRECTION					=4,
	SST_MS_MOVE_STATUS					=5,
	SST_MS_MOVE_SPEED					=6,
	SST_MS_ROTATE_STATUS				=7,
	SST_MS_ROTATE_SPEED					=8,
	SST_MS_TARGET_XPOS					=9,
	SST_MS_TARGET_YPOS					=10,
	SST_MS_TARGET_HEIGHT				=11,
};

enum SST_BASE_CHAR_INFO
{
	SST_BCI_CHAR_ID						=21,
	SST_BCI_CHAR_TYPE					=22,
	SST_BCI_CHAR_NAME					=23,
	SST_BCI_RACE						=24,
	SST_BCI_GENDER						=25,
	SST_BCI_CREATURE_DISPLAY_ID			=26,
	SST_BCI_CHAR_SKIN_COLOR				=27,
	SST_BCI_CHAR_HAIR_COLOR				=28,
	SST_BCI_CHAR_FACE_TYPE				=29,
	SST_BCI_CHAR_HAIR_TYPE				=30,
	SST_BCI_CHAR_BEARD_TYPE				=31,
	SST_BCI_IS_CHAR_BALD				=32,
	SST_BCI_MAP_ID						=33,
};

enum MEMBER_FLAG_MOVE_STATUS
{
	MF_MS_XPOS							=1,
	MF_MS_YPOS							=(1<<1),
	MF_MS_HEIGHT						=(1<<2),
	MF_MS_DIRECTION						=(1<<3),
	MF_MS_MOVE_STATUS					=(1<<4),
	MF_MS_MOVE_SPEED					=(1<<5),
	MF_MS_ROTATE_STATUS					=(1<<6),
	MF_MS_ROTATE_SPEED					=(1<<7),
	MF_MS_TARGET_XPOS					=(1<<8),
	MF_MS_TARGET_YPOS					=(1<<9),
	MF_MS_TARGET_HEIGHT					=(1<<10),
	MF_MS_ALL							=0x7FF,
};

enum MEMBER_FLAG_BASE_CHAR_INFO
{
	MF_BCI_CHAR_ID						=1,
	MF_BCI_CHAR_TYPE					=(1<<1),
	MF_BCI_CHAR_NAME					=(1<<2),
	MF_BCI_RACE							=(1<<3),
	MF_BCI_GENDER						=(1<<4),
	MF_BCI_CREATURE_DISPLAY_ID			=(1<<5),
	MF_BCI_CHAR_SKIN_COLOR				=(1<<6),
	MF_BCI_CHAR_HAIR_COLOR				=(1<<7),
	MF_BCI_CHAR_FACE_TYPE				=(1<<8),
	MF_BCI_CHAR_HAIR_TYPE				=(1<<9),
	MF_BCI_CHAR_BEARD_TYPE				=(1<<10),
	MF_BCI_IS_CHAR_BALD					=(1<<11),
	MF_BCI_MAP_ID						=(1<<12),
	MF_BCI_ALL							=0x1FFF,
};

enum EM_OBJECT_MEMBER_FLAGS
{
	OMF_MOVE_STATUS,
	OMF_BASE_CHAR_INFO,
	OMF_MAX,
};

struct OBJECT_MEMBER_FLAGS
{
	UINT64 MemberFlags[OMF_MAX];	
};

const OBJECT_MEMBER_FLAGS MF_MOVE_STATUS={MF_MS_ALL,0};
const OBJECT_MEMBER_FLAGS MF_MOVE_STATUS_ONLY_MOVE={MF_MS_XPOS|MF_MS_YPOS|MF_MS_HEIGHT|MF_MS_MOVE_STATUS|MF_MS_MOVE_SPEED|MF_MS_TARGET_XPOS|MF_MS_TARGET_YPOS|MF_MS_TARGET_HEIGHT,0};
const OBJECT_MEMBER_FLAGS MF_MOVE_STATUS_ONLY_ROTATE={MF_MS_DIRECTION|MF_MS_ROTATE_STATUS|MF_MS_ROTATE_SPEED,0};

const OBJECT_MEMBER_FLAGS MF_BASE_CHAR_INFO={0,MF_BCI_ALL};

enum SST_CHAR_INFO_LIST
{
	SST_CIL_CHAR_INFO=1,
};

enum GET_MODIFY_FLAG_TYPE
{
	GMFT_COPY,
	GMFT_AND,
	GMFT_OR,
};

enum MAP_OBJECT_FLAG
{
	MOF_HIDE_MODE=(1),
	MOF_USE_MSG_CACHE=(1<<1),
};

enum MAP_OBJECT_HIDE_TYPE
{
	MOHT_SHOW,
	MOHT_HIDE,
	MOHT_LEAVE_MAP,
};

enum SST_GAME_DEMO_MSG_PACKET
{
	SST_GDMP_MSG=1,
};

enum SST_GAME_DEMO_MSG
{
	SST_GDM_MSG_ID=1,
	SST_GDM_MSG_DATA,
};

enum COMMON_MSG_RESULT_TYPE
{
	CMRT_OK=0,
	CMRT_FAILED=-1,
};



enum PLAYER_LOGIN_RESULT_TYPE
{
	PLRT_OK=CMRT_OK,	
	PLRT_FAILED=CMRT_FAILED,
};

enum PLAYER_CREATE_CHAR_RESULT_TYPE
{
	PCCRT_OK=CMRT_OK,
	PCCRT_CHAR_NAME_EXIST,
	PCCRT_CHAR_DATA_ERROR,
	PCCRT_FAILED=CMRT_FAILED,
};


enum MAP_OBJECT_REGISTER_RESULT_TYPE
{
	MORRT_OK,
	MORRT_ALREADY_REGISTER,
	MORRT_FAILED=-1,
};







enum UPDATE_MAP_OBJECT_RESULT_TYPE
{
	UMORT_OK,
	UMORT_FAILED=-1,
};



enum QUERY_CHAR_INFO_RESULT_TYPE
{
	QCIRT_OK,
	QCIRT_CHAR_NOT_EXIST,
	QCIRT_FAILED=-1,
};

enum CHAR_TYPE
{
	CT_NONE,
	CT_PLAYER,
	CT_NPC,
};


enum HIDE_ON_MAP_RESULT_TYPE
{
	HOMRT_OK=CMRT_OK,
	HOMRT_TARGET_NOT_FIND,
	HOMRT_FAILED=CMRT_FAILED,
};

enum TELEPORT_IN_MAP_RESULT_TYPE
{
	TIMRT_OK=CMRT_OK,
	TIMRT_TARGET_NOT_FIND,
	TIMRT_FAILED=CMRT_FAILED,
};


enum MOVE_STATUS
{
	MS_NONE,
	MS_STOP,
	MS_FORWARD,
	MS_BACKWORD,
	MS_LEFT,
	MS_RIGHT,
	MS_LEFT_FORWARD,
	MS_RIGHT_FORWARD,
};

enum ROTATE_STATUS
{
	RS_NONE,
	RS_STOP,
	RS_LEFT,
	RS_RIGHT,
};

#define MAKE_LW_ID(Type,Index)				(((((UINT64)Type)&0xFF)<<56)|(Index&0xFFFFFFFFFFFFFF))

#define MAX_CHAR_NAME_LEN				64
#define MAX_MSG_SIZE					3000
#define MAX_MSG_PACKET_SIZE				4096

#define MAX_MOVE_STATUS_SIZE			128
#define MAX_PLAYER_CHAR_INFO_SIZE		(128+MAX_CHAR_NAME_LEN+MAX_MOVE_STATUS_SIZE)
#define MAX_ACCOUNT_CHAR				9

#define RUN_SPEED						6.94f
#define WALK_SPEED						2.5f
#define ROTATE_SPEED					(0.5*PI)

#define NPC_ID_START					100000